Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix binstubs path in webpacker:check_binstubs rake task #990

Merged

Conversation

monad-san
Copy link
Contributor

Fix rails webpacker:check_binstubs rake task bug.
In new rails project, this rake task fails even if rails webpacker:install has already executed.


bin/webpack-dev-server and bin/webpack is converted to binstubs by #833 .
These files are not in bin/ directory but paths of them are remained around this repository yet.
we might as well remove all paths.

@rossta
Copy link
Member

rossta commented Nov 3, 2017

I'm not able to reproduce the failure you describe. I just created a new rails app with webpacker and ran rails webpacker:install. When I run rails webpacker:check_binstubs, I don't see any failures.

The install task installs the binstubs here:

run "bundle binstubs webpacker"

Could you provide more info about the issue you're seeing and how to reproduce?

@monad-san
Copy link
Contributor Author

Could you provide more info about the issue you're seeing and how to reproduce?

Sorry, I have not provided important information.
If bundle bin path is changed manually by bundle install --path=vendor/bundle --binstubs=vendor/bundle/bin, rails webpacker:check_binstubs will fail.
(I think it happens also by bundle binstubs --path=vendor/bundle/bin)

% mkdir rails_app && cd rails_app
% bundle init
Writing new Gemfile to /***/rails_app/Gemfile
% nano Gemfile
% cat Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "rails"
% bundle install --path=vendor/bundle --binstubs=vendor/bundle/bin
(omit)
% rails new . --webpack=react
(omit)
        run  yarn add @rails/webpacker coffeescript@1.12.7 from "." 
(omit)
Webpacker successfully installed 🎉 🍰
       rails  webpacker:install:react
Webpack binstubs not found.
Have you run rails webpacker:install ?
Make sure the bin directory or binstubs are not included in .gitignore
Exiting!
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted

% rails webpacker:check_binstubs
Webpack binstubs not found.
Have you run rails webpacker:install ?
Make sure the bin directory or binstubs are not included in .gitignore
Exiting!

Or, should not we change bundle bin path in rails app?

@gauravtiwari gauravtiwari merged commit b47f7dd into rails:master Nov 6, 2017
@gauravtiwari
Copy link
Member

Thanks @monad-y 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants